package com.sumainfor.wx.tenant.controller.rentadviser;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.tenant.feign.Zfeign.ZpcMktFeign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.Map;

/**
 * 租客换房申请
 */
@RestController
@RequestMapping("/rentadviser/RdWxHousingExc")
public class RdWxHousingExcController implements Serializable {
    Logger log = LoggerFactory.getLogger(RdWxHousingExcController.class);// 日志
    @Autowired
    private ZpcMktFeign zpcMktFeign;
    /**
     * 租客发起换房申请
     */
    @PostMapping("/addHousingExc")
    public JsonResult addHousingExc(@RequestBody Map<String,Object> params){
        System.out.println("租客端参数:"+params);
        return zpcMktFeign.addHousingExc(params);
    }
    /**
     * 根据合同编号查询租客是否已经发起过换房
     */
    @GetMapping("/getHousingExcCount")
    public JsonResult getHousingExcCount(@RequestParam Map<String,Object> params){
        System.out.println("租客端参数:"+params);
        return zpcMktFeign.getHousingExcCount(params);
    }
    /**
     * 租客取消换房申请
     */
    @PostMapping("/upHousingExc")
    public JsonResult upHousingExc(@RequestBody Map<String,Object> params){
        System.out.println("租客端参数:"+params);
        return zpcMktFeign.upHousingExc(params);
    }
}
